<template>
	<view>
		<image class="container1" src="/static/logo.png"></image>
		<view class="title">
			欢迎使用 律师人工智能办案系统
		</view>
		
		<view class="viewTinputT flex-row-space-between">
			<view class="flex-row-flex-start" style="width: 116rpx;">
				<view class="bianhao">
					+86
				</view>
				<image src="/static/login_down.png" style="width: 14rpx;height: 8rpx;margin-left: 14rpx;"></image>
			</view>
			<input class="inputT" v-model="mobile" type="number" style="width: 502rpx;" placeholder="请输入手机号" />
		</view>
		<view class="viewTinputT">
			<view class="viewT">
				密码
			</view>
			<input placeholder="请输入密码" :password="true" v-model="captcha" style="width: 618rpx;margin-top: 16rpx;"/>
		</view>
		
		<view @click="loginMobile()" class="loginButton">
			登录
		</view>
		<view class="xyTitle  flex-row-space-between">
			<text @click="forgetPasswordClick">
				忘记密码
			</text>
			<text @click="registerClick">
				注册账号
			</text>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mobile: '',
				captcha: ''
			}
		},
		onShow() {

		},
		onLoad() {

		},
		methods: {
			forgetPasswordClick(){
				uni.navigateTo({
					url:'/pages/forgetPassword/forgetPassword'
				})
			},
			registerClick(){
				uni.navigateTo({
					url:'/pages/register/register'
				})
			},
			loginMobile() {
				uni.switchTab({
					url: "/pages/index/index"
				})
				// if (!(/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.mobile))) {
				// 	uni.showToast({
				// 		title: '请输入正确的手机号',
				// 		icon: 'none'
				// 	});
				// 	return false;
				// }
				// if(!this.captcha.length){
				// 	this.showToast('请输入验证码')
				// 	return
				// }
				// let param = {
				// 	'url': 'api/user/mobilelogin',
				// 	'data': {
				// 		mobile: this.mobile,
				// 		captcha: this.captcha
				// 	},
				// 	'method': 'POST'
				// }
				// uni.showLoading({})
				// this.$myRequest(param).then(res => {
				// 	uni.hideLoading()
				// 	if (res.code == 1) {
				// 		this.showToast('登录成功')
				// 		uni.setStorageSync('userinfo', res.data.userinfo)
				// 		uni.setStorageSync('token', res.data.userinfo.token)
				// 		setTimeout(() => {
				// 			uni.switchTab({
				// 				url: "/pages/index/index"
				// 			})
				// 		}, 1500)
				// 	} else {
				// 		if(res.msg){
				// 			this.showToast(res.msg)
				// 		}else{
				// 			this.showToast('登录失败')
				// 		}
				// 	}
				// })
			},
			showToast(title) {
				uni.showToast({
					title: title,
					icon: 'none'
				})
			},
		}
	}
</script>

<style lang="scss">
	page{
		background: #FFFFFF;
	}
	.container1{
		margin-left: 66rpx;
		margin-top: 80rpx;
		width: 100rpx;
		height: 100rpx;
	}
	.title {
		margin-left: 66rpx;
		margin-top: 34rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 800;
		font-size: 40rpx;
		color: #333333;
	}
	.viewTinputT{
		margin-left: 66rpx;
		width: 618rpx;
		padding-top: 24rpx;
		padding-bottom: 24rpx;
		border-bottom: 1rpx solid #CCCCCC;
	}
	.bianhao{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	.viewT{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #333333;
	}
	.inputT{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #333333;
	}
	
	.loginButton {
		margin-top: 60rpx;
		margin-left: 64rpx;
		width: 620rpx;
		height: 90rpx;
		background: linear-gradient( to bottom, #E93548 0%, #F35B43 100%);
		box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(235,43,59,0.4);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 32rpx;
		color: #FFFFFF;
		line-height: 90rpx;
		text-align: center;
	}
	.xyTitle {
		margin-top: 20rpx;
		margin-left: 65rpx;
		width: 620rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 28rpx;
		color: #333333;
	}
	
</style>
